{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item" >

                        <!--<div class="layui-col-md6 layui-input-inline">-->
                            <!--<input type="text" id="keyword" class="layui-input search" name="keyword" placeholder="船长姓名/ID"/>-->
                        <!--</div>-->

                        <div class="layui-input-inline layui-form">
                            <select name="ls_status">
                                <option  value="">不限状态</option>
                                <option  value="2">待处理</option>
                                <option  value="3">待审核</option>
                                <option  value="4">已驳回</option>
                                <option  value="5">已完成</option>
                            </select>
                        </div>

                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--操作框开始-->

                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="testReload"></table>

                    <!--状态显示模板-->
                    <script type="text/html" id="lsStatus">
                        {{# if(d.ls_status == 2){ }}
                        待处理
                        {{# } }}
                        {{# if(d.ls_status == 3){ }}
                        待审核
                        {{# } }}
                        {{# if(d.ls_status == 4){ }}
                        已驳回
                        {{# } }}
                        {{# if(d.ls_status == 5){ }}
                        已完成
                        {{# } }}
                    </script>

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        {{# if(d.member_type == 1 || d.member_type == 4){ }}
                        {{# if(d.ls_status == 2) { }}
                        <a href="javascript:;" onclick="wk.href('{:url('changeMark')}?id={{d.id}}')" class="btn btn-warning btn-xs m-r-xs" title="修改成绩">修改成绩</a>
                        {{# } }}
                        {{# } }}

                        {{# if(d.member_type == 1 || d.member_type == 2){ }}
                        {{# if(d.ls_status == 3) { }}
                        <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('commitMark')}','确认修改临时成绩吗？')" class="btn btn-danger btn-xs m-r-xs" title="确认修改">确认修改</a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('refsualMark')}','确认驳回临时成绩吗？')" class="btn btn-warning btn-xs m-r-xs" title="驳回修改">驳回修改</a>
                        {{# } }}
                        {{# } }}


                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Sailingyy/index")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                  {type: 'checkbox', fixed: 'left'}
                  {type:'numbers', width: '', title: '序号'}
                , {field: 'user_real_name', width: '', title: '船长姓名', align: 'center'}
                , {field: 'user_create_id', width: 140, title: '船长ID', align: 'center'}
                , {field: 'user_phone', width: 180, title: '注册手机号', align: 'center'}
                , {field: 'mg_name', width: 100, title: '组别', align: 'center'}
                , {field: 'temp_score', width: 100, title: '成绩', align: 'center'}
                , {field: 'fan_code', width: 100, title: '帆号', align: 'center'}
                , {field: 'ls_status', width: 100, title: '状态', align: 'center', toolbar: '#lsStatus'}
                , {field: 'ls_change_score', width: 120, title: '修改成绩', align: 'center'}
                , {field: 'ls_yiyi_content', width: '', title: '异议内容', align: 'center'}
                , {field: 'ls_commit_time', width: 160, title: '提交时间', align: 'center'}
                , {fixed: 'right', width: 200, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });
        var getIds = function () {
            var ids = [];
            var checkStatus = table.checkStatus('testReload')
                    ,data = checkStatus.data;
            $.each(data,function(index,item){
                ids.push(item['match_id'])
            });
            return ids;
        }
    });
</script>
</body>
</html>